from django import template

register = template.Library()

@register.filter
def subtract(value, arg):
    return value - arg

def add_class(field, css_class):
    return field.as_widget(attrs={"class": css_class})